<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="utf-8">
    <title>新增话术</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" th:href="@{/js/layui/css/layui.css}"  media="all" />
    <link rel="stylesheet" th:href="@{/css/public.css}"  media="all" />
    <link rel="stylesheet" th:href="@{/css/knowledgeBase/selectStyle.css}"/>
    <link rel="stylesheet" th:href="@{/js/layui/module/formSelects/css/formSelects-v4.css}" />
    <style>
        .xm-select-dl {height: 150px;}

    </style>
</head>
<body>
<div style="width:100%;-webkit-backface-visibility: hidden;">
    <div class="houselabel">
        <form class="layui-form layui-row" style="padding: 5px 5px;" >
            <div class="layui-row layui-col-space10" style="text-align: center">
                <div class="layui-form-item magt3">
                    <label class="layui-form-label">话术名称:</label>
                    <div class="layui-input-block">
                        <!--<input type="text" class="layui-input" name="packageName"  placeholder="请输入话术名称">-->
                        <input type="text" name="packageName" lay-verify="required" placeholder="请输入话术名称" autocomplete="off" class="layui-input"
                               required th:value="${speakingPackage?.packageName}">
                    </div>
                </div>
                <div class="layui-form-item" >
                    <label class="layui-form-label">请选择行业话术包:</label>
                    <div class="layui-input-block">
                        <select name="hadIndustryTypeId" xm-select="hadIndustryTypeIds"  xm-select-height="125px">
                        </select>
                    </div>
                </div>

                <div class="layui-form-item" style="display: none">
                    <label class="layui-form-label">类型:</label>
                    <div class="layui-input-inline" width="230px">
                        <th:block th:if="${types!=null}">
                            <select name="packageType" lay-filter="packageType" id="packageType" lay-search="" >
                                <option value="">请选择任务类型(可输关键词)</option>
                                <option th:each="it:${types}"  th:value="${it.value}" th:text="${it.desc}"
                                        th:selected="(${it.value} == ${speakingPackage?.packageType?.value})"></option>
                            </select>
                        </th:block>
                    </div>
                </div>

                <div class="layui-form-item" id="belongKnowledgeTypeDiv" style="display: none">
                    <label class="layui-form-label">所属行业类型:</label>
                    <div class="layui-input-block">
                        <th:block th:value="${belongIndustryTypes!=null}">
                            <select name="belongIndustryTypeId" lay-filter="belongKnowledgeTypes" id="belongIndustryTypeId" lay-search="" lay-verify="belongIndustryTypeIdNotNull" >
                                <option value="">请选择所属知识库类型(可输关键词)</option>
                                <option th:each="it:${belongIndustryTypes}" th:value="${it.id}" th:text="${it.name}"></option>
                            </select>
                        </th:block>
                    </div>
                </div>

                <div class="layui-form-item"  style="display: none" >
                    <input type="text" name="id" th:value="${speakingPackage?.id}" value="0" />
                </div>
                <div class="layui-form-item"  style="display: none" >
                    <input type="text" name="speakingPackageUseage" th:value="${speakingPackage?.speakingPackageUseage?.value}" value="" />
                </div>
            </div>
            <div style="position:absolute;left: 0px;bottom: 0px; width: 100%;height: 50px;background-color: #f2f2f2;padding: 0px;display: none">
                <button type="button" class="layui-btn" lay-submit lay-filter="add" style="width: 100px;float: right;margin-top: 7px;margin: 5px 5px;">保存</button>
                <button type="button" class="layui-btn"  id="cancel"  style="width: 100px;margin-top: 7px;background-color: #b2b2b2;float: right;margin: 5px 5px;" >取消</button>
            </div>
        </form>
    </div>
</div>
<script th:inline="javascript">
    const baseUrl = [[${#servletContext.contextPath}]];
    const treeMap = [[${treeMap}]];
    console.log(treeMap);
    var speakingPackage = [[${speakingPackage}]];
    if(speakingPackage != undefined && speakingPackage !=null){
        console.log(speakingPackage.hadIndustryTypeId);
    }

</script>
<script type="text/javascript"   th:src="@{/js/layui/layui.js}"></script>
<script type="text/javascript"   th:src="@{/js/page/flow/config/addSpeakingPackage.js}"></script>
<script type="text/javascript"   th:src="@{/js/jquery-1.7.2.min.js}"></script>
<script type="text/javascript"   th:src="@{/js/page/utils.js}"></script>
</body>
</html>